
<?php
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use yii\grid\GridView;
use yii\helpers\Url;
$this->params['breadcrumbs'][] = ['label' => $model->page_id, 'url' => ['diyupdate', 'id' => $model->page_id]];
?>

<div class="modal-dialog" style="width:900px;">
		<div class="modal-content" >
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				<h4 class="modal-title">自定义页面</h4>
			</div>
			<div class="modal-body">
				<div id="type-creater-widget">
					<?php 
						$form = ActiveForm::begin([
							'options' => ['class' => 'form-horizontal',
							'id'=>'type-form','enctype'=>'multipart/form-data',
		'novalidate'=>'novalidate','data-widget-cid'=>'widget-9'],
							'action'=>Url::to(['operate/diyupdate']),
							'method'=>'post',
							'fieldConfig' => [
								'template' => '<div class="form-group"><center><label class="col-md-2 control-label" for="type-name-field">{label}</label></center><div class="col-md-8 controls">{input}{error}</div></div>'
							], 
						]);
					?>
					<?= $form->field($model, 'page_id', ['template'=>'<div class="form-group"><div class="col-md-8 controls">{input}{error}</div></div>'])->hiddenInput() ?>
					<?= $form->field($model, 'page_title',['inputOptions'=>['placeholder'=>'请输标题']])->textInput() ?>

					<?= $form->field($model, 'page_url',['inputOptions'=>['placeholder'=>'请输url']])->textInput() ?>

					<?php $model->is_show=1; echo $form->field($model,'is_show')->radioList(['1'=>'显示','0'=>'不显示'],['separator'=>" ","style"=>"padding-top:6px;"]); ?>

					<?= $form->field($model, 'page_text')->textarea(['rows'=>10,'id' => 'myeditor'.$model->page_id,'class'=>'ckeditor']) ?>
					<div class="modal-footer">	
						<button type="button" class="btn btn-link" data-dismiss="modal" tabindex="6">取消</button>
						<?= Html::submitButton('保存', ['class' => 'btn btn-success','id'=>'category-create-btn']) ?>
					</div>
				</div>
			</div>
			<?php ActiveForm::end(); ?>
		</div>
	</div>
<?= Html::jsFile('/ueditor/ueditor.config.js')?>
<?= Html::jsFile('/ueditor/_examples/editor_api.js')?>
<script type="text/javascript">
	myeditor = $("#page-page_id").val()

    var ue = UE.getEditor('myeditor'+myeditor);
</script>